param ( $versionNo = '1.0.0' )

Write-Host You can set package version number with version flag

if (-not(Test-Path .\Eksponent.CropUp\obj\Release\Eksponent.CropUp.dll) -or -not(Test-Path .\Eksponent.CropUp.UmbracoIV\obj\Release\Eksponent.CropUp.UmbracoIV.dll)) {
    Write-Host Remember to build in release mode  first -ForegroundColor Red
}
else {
    # First copy over all dll files
    Write-Host Getting CropUp dll files -ForegroundColor Green
    copy .\Eksponent.CropUp\obj\Release\*.dll '.\Umbraco NugetPackage\lib\net40'
    copy .\Eksponent.CropUp.UmbracoIV\obj\Release\*.dll '.\Umbraco NugetPackage\lib\net40'
    # Then create package
    Write-Host Creating package -ForegroundColor Green
    & 'nuget' pack '.\Umbraco NugetPackage\Package.nuspec' -version $versionNo
}

